package com.ruoyi.project.treat.service.impl;

import com.ruoyi.project.treat.domain.SystemDrug;
import com.ruoyi.project.treat.domain.TreatPatient;
import com.ruoyi.project.treat.domain.TreatPatientHistory;
import com.ruoyi.project.treat.mapper.TreatNewVisitMapper;
import com.ruoyi.project.treat.service.ITreatNewVisitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TreatNewVisitServiceImpl implements ITreatNewVisitService {
    @Autowired
    private TreatNewVisitMapper newVisitMapper;

    /**
     * 根据挂号状态获取挂号详细信息
     *
     * @param registerId 挂号ID
     * @return 患者对象信息
     */
    @Override
    public TreatPatient selectPatientByRegisterId(String registerId) {
        return newVisitMapper.selectPatientByRegisterId(registerId);
    }

    /**
     * 新增病历信息
     *
     * @param patientHistory 病历信息
     * @return 结果
     */
    @Override
    public int insertPatientHistory(TreatPatientHistory patientHistory) {
        newVisitMapper.insertPatientHistory(patientHistory);
        return patientHistory.getHistoryId();
    }

    /**
     * 根据患者ID状态获取挂号详细信息
     *
     * @param patientId 挂号ID
     * @return 病例对象信息
     */
    @Override
    public List<TreatPatientHistory> selectPatientHistoryByPatientId(String patientId) {
        return newVisitMapper.selectPatientHistoryByPatientId(patientId);
    }

    /**
     * 查询药品处方信息
     *
     * @return 病例对象信息
     */
    @Override
    public List<SystemDrug> selectSystemDrugList(String drugName) {
        return newVisitMapper.selectSystemDrugList(drugName);
    }
}
